"""
公用方法
"""
from account.models import Account


def update_inviter_code(invite_code):
    """
    用户填写邀请码注册后，将邀请人账号添加对应积分
    :param invite_code:
    :return:
    """
    if invite_code:
        account = Account.objects.filter(invited_code=invite_code).first()
        if account:
            account.add_invite_integral(10, '邀请积分')
